package com.huanxing.cloud.upms.common.feign;

import com.huanxing.cloud.common.core.constant.SecurityConstants;
import com.huanxing.cloud.common.core.constant.ServiceNameConstants;
import com.huanxing.cloud.common.core.entity.Result;
import com.huanxing.cloud.upms.common.entity.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "feignSysUserService", value = ServiceNameConstants.UMPS_ADMIN_SERVICE)
public interface FeignSysUserService {
  /**
   * 通过用户名查询用户、角色信息
   *
   * @param username 用户名
   * @return R
   */
  @GetMapping("/user/info/{username}")
  Result<SysUser> getUserInfo(
      @PathVariable("username") String username,
      @RequestHeader(SecurityConstants.SOURCE) String source);
}
